define(["constant", "handlebars", "site", "public", 'uploadImage', 'static/js/page/common/common.js'], function (Constant, Handlebars, site) {
    var newVar = {
        selectRepanymentWayList: "manager/selectRepanymentWayList.do",
        selectRenewalRead: "manager/selectRenewalRead.do",
        selectRenewal: "manager/selectRenewal.do",
        submitRenewal: "manager/submitRenewal.do",
        selectPaymentSort: "manager/selectPaymentSort.do",
        submitReceivablesInit: "manager/submitReceivablesInit.do",
        submitReceivables: "manager/submitReceivables.do",
        selectLoanMethodList: "manager/selectLoanMethodList.do",
        selectPageLogList: "manager/selectPageLogList.do",  //回访记录
        DailyInterestRate: "manager/DailyInterestRate.do",
        checkVisit: "manager/checkVisit.do",
        checkDiscuss: "manager/checkDiscuss.do",
        deleteDiscuss: "manager/deleteDiscuss.do",
        deliverDiscuss: "manager/deliverDiscuss.do",
        submitVisit: "manager/submitVisit.do",
        selectVisitType: "manager/selectVisitType.do",
        selectOrderVisitListAll: 'manager/selectOrderVisitListAll.do'
    }

    //渲染搜索框的贷款方式
    site.send({
        url: url.selectLoanMethodList,
        callback: function (data) {
            data = JSON.parse(data);
            if (data.type == '1') {
                var source = $("#loanMethod_list_tpl").html();
                var template = Handlebars.compile(source);
                var list = data;
                var html = template(list);
                $('#loan_way').append(html);
            }
        }
    })

    var repaymentWay = {};
    var numed;
    var flun_type;
    var is_month_repayment_money;
    var is_comprehensive;
    var periods;
    var late_days;
    var is_penalty;
    var is_late_fee;
    var admin_id;
    var at_name;
    var plan_payment_money;
    var repayment_way;
    var loan_type;

    site.send({
        url: url.selectRepanymentWayList,
        callback: function (data) {
            data = JSON.parse(data);
            var list = data.content;
            if (data.type == '1') {
                for (var i = 0; i < list.length; i++) {
                    var v = list[i];
                    repaymentWay[v.id] = v;
                }
            }
        }
    })

    $(".datepicker").datepicker({
        format: 'yyyy-mm-dd',
        autoclose: true,
        pickerPosition: 'bottom'
    })


})